<template>
	<view class="mainpadding2">
		<!-- <view class=" flexcenter">
			<u-tabs :list="list1" lineColor="#C01933" @click="changetab" :activeStyle="{
				    color: '#C01933',
				    fontWeight: 'bold',
				    transform: 'scale(1.05)'
				}" :inactiveStyle="{
				            color: '#999999',
							fontWeight: 'bold',
				            transform: 'scale(1)'
				        }" itemStyle="padding-left: 50px; padding-right: 50px; height: 44px;"></u-tabs>
		</view> -->
		<view class="flexcenter" v-if="!list.data.length">
			<view class="placeholderimage" style="margin-top: 300rpx;"></view>
		</view>
		<view class="mainpadding ffffff radius margin_top " v-for="item in list.data" :key="item.id">
			<view class="flexbetween">
				<view class="flexleft">
					<image class="touxiang margin_right2" :src="item.lyuserinfo.avatar_text" mode=""></image>
					<view class="">
						<view class="ershiba xiaohei fonweight">{{item.memo}}</view>
						<view class="strongtext xiaohui nofonweight margin_top1">{{item.createtime_text}}</view>
					</view>
				</view>
				<view class="flexright">
					<view class="xiaohong sanshier">{{item.money}}</view>
				</view>
			</view>
			<view class="strongtext xiaohui textright ">邀请人：{{item.lyuserinfo.nickname}}</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				current: 1,
				list1: [{
						name: '直接邀请',
						value: 1,
					},
					{
						name: '间接邀请',
						value: 2,
					}
				],
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			init(isPage, page) { //提现记录
				let _this = this;
				let url = '/api/user/getUserYjMoneyLog'
				httpRequest.request(url, 'GET', {
					page: page || 1,
					limit: _this.limit,
					// type:this.current
				}, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
			changetab(e) {
				this.current = e.value
				this.init()
			},
		}
	}
</script>

<style lang="scss" scoped>
.touxiang {
		width: 96rpx;
		height: 96rpx;
		border-radius: 50%;

		image {
			border-radius: 50%;
			width: 100%;
			height: 100%;
		}
	}
</style>
